package io.renren.service.impl;

import io.renren.dao.WechatTokenDao;
import io.renren.entity.UserEntity;
import io.renren.service.WechatTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class WechatTokenServiceImpl implements WechatTokenService {
    @Autowired
    private WechatTokenDao wechatTokenDao;

    @Override
    public Long getUserId(String openId) {
        Long userId = wechatTokenDao.getUserId(openId);
        return userId;
    }

    @Override
    public void createUser(Map newUser) {
        wechatTokenDao.createUser(newUser);
    }

    @Override
    public UserEntity getUserByopenId(String openId) {
        return wechatTokenDao.getUserByopenId(openId);
    }
}
